#include "../sylar/sylar.h"

sylar::Logger::ptr g_logger = SYLAR_LOG_NAME("root");

void test_fiber()
{static int s_count = 5;
    SS() << "test in fiber s_count=" << s_count;
    

    sleep(1);
    if(--s_count >= 0)
    {

        sylar::Scheduler::GetThis()->schedule<decltype(&test_fiber)>(&test_fiber);
    }
}
int main(int argc, char **argv)
{

    sylar::Scheduler sc(3, true, "test_fiber");
    sc.start();
    sleep(2);
    SS() << "schedule";
    sc.schedule<decltype(&test_fiber)>(&test_fiber);
    sc.stop();
    SS() << "all down";
    return 0;
}
